package com.jiangcheng.config.interceptor;

import com.jiangcheng.interceptor.TimeCostInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 类名称：InterceptorConfig<br>
 * 类描述：<br>
 * 创建时间：2018年09月11日<br>
 *
 * @author jiangcheng
 * @version 1.0.0
 */
@Configuration
public class InterceptorConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new TimeCostInterceptor()).addPathPatterns("/**");
        super.addInterceptors(registry);
    }
}
